bitkeeper revision 1.1159.1.78 (41238a80nRCeFQAmbGc_sFDGt7oOhw)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 18 Aug 2004 16:57:36 +0000 (16:57 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Wed, 18 Aug 2004 16:57:36 +0000 (16:57 +0000)
Fix task queues.

linux-2.4.26-xen-sparse/include/asm-xen/queues.h
linux-2.6.7-xen-sparse/drivers/xen/console/console.c
linux-2.6.7-xen-sparse/include/asm-xen/queues.h

index 64a4cbee85fc9947227997f9dd7408a030debe61..38dfa48bba6fc775a1854482c181a995e46640a3 100644 (file)
 #include <linux/list.h>
 #include <linux/tqueue.h>
 
-#define DECLARE_WORK(_name, _fn, _arg) \
-    struct tq_struct _name = { .routine = _fn, .data = _arg }
+#define DECLARE_TQUEUE(_name, _fn, _arg) \
+    struct tq_struct _name = { LIST_HEAD_INIT((_name).list), 0, _fn, _arg }
+
+#define DECLARE_WORK(_name, _fn, _arg) DECLARE_TQUEUE(_name, _fn, _arg)
 #define schedule_work(_w) schedule_task(_w)
 
 #endif /* __QUEUES_H__ */
index 7942b12b6017f151dd486db0f465b09799e785ea..c7c3d76e6940c34671c3beab7e6b7bae47e5ae44 100644 (file)
@@ -74,7 +74,9 @@ static void __xencons_tx_flush(void);
 /* This task is used to defer sending console data until there is space. */
 static void xencons_tx_flush_task_routine(void *data);
 
-static struct tq_struct xencons_tx_flush_task;
+static DECLARE_TQUEUE(xencons_tx_flush_task, 
+                      xencons_tx_flush_task_routine,
+                      NULL);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static struct tty_driver *xencons_driver;
@@ -631,8 +633,6 @@ static int __init xencons_init(void)
     if ( xc_mode == XC_OFF )
         return 0;
 
-    INIT_TQUEUE(&xencons_tx_flush_task, xencons_tx_flush_task_routine, NULL);
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
     xencons_driver = alloc_tty_driver((xc_mode == XC_SERIAL) ? 
                                       1 : MAX_NR_CONSOLES);
index f2a66a71bfcb1c58227bba1cb39b173e69fafa3e..6324092bd41b18a260450db96df2a39f9fd895e0 100644 (file)
@@ -32,6 +32,9 @@ struct tq_struct {
         (_name)->pending = 0;                       \
         INIT_WORK(&(_name)->work, (_fn), (_arg));   \
     } while ( 0 )
+#define DECLARE_TQUEUE(_name, _fn, _arg)                                    \
+    struct tq_struct _name = { __WORK_INITIALIZER((_name).work, _fn, _arg), \
+                               LIST_HEAD_INIT((_name).list), 0 }
 
 typedef struct {
     struct list_head list;